package com.lgc.webtest.controller;

import com.lgc.webtest.service.ExcelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/importexcel")
public class ImportExcelController {

    @Resource
    private ExcelService excelService;

    @RequestMapping(value = "/import", method = RequestMethod.POST)
    public String importExcel(MultipartFile file) {

        String userId = "testUser";
        Map<String,String> map = excelService.importExcel(file, userId);

        return map.get("left");
    }

}
